<template>
  <div class="container">
    <div class="tab flex-row bd-bottom">
      <div @click="tabClick(1)" v-bind:class="[active==1 ? 'active' : '']">我打赏</div>
      <div @click="tabClick(2)" v-bind:class="[active==2 ? 'active' : '']">被打赏</div>
    </div>
    <div v-for="item,index in items" class="flex-row item bd-bottom">
        <div class="flex-grow-1">2018-05-07</div>
        <div class="flex-grow-0">-5</div>
    </div>
  </div>
</template>
<script>
export default ({
  data() {
    return {
        items:[1,2,3,4,6],
        active:1

    }
  },
   methods: {
    tabClick(index) {
      this.active = index;
      this.$forceUpdate(); 
    }
  }
})


</script>
<style scoped lang="less">
.tab {
  justify-content: space-around;
  background-color: #fff;
  div {
    padding: .6rem;
    font-size: .6rem;
  }
  .active {
    border-bottom: 2px solid #F75B93;
  }
}
.item{
  padding:.5rem;
  font-size:.6rem;
  background-color:#fff;
}
</style>
